<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link th:href="@{/css/style.css}" rel="stylesheet" type="text/css" />
<script type="text/javascript" th:src="@{/js/jquery.js}"></script>
</head>

<body>
<div class="place"> <span>位置：</span>
  <ul class="placeul">
    <li>采购管理</li>
    <li>品牌管理</li>
    <li>修改</li>
  </ul>
</div>
<div class="formbody">
  <div class="formtitle"><span>品牌信息</span></div>
  <form action="/erp/purchase/cbrand/doupdate" method="post" id="bform">
  <ul class="forminfo">
    <li>
      <span th:text="${msg}"></span>
    </li>
    <li>
      <label>品牌名称</label>
      <input name="brandId" type="hidden" th:value="${cbrand.brandId}">
      <input name="brandName" type="text" th:value="${cbrand.brandName}" class="dfinput" />
      <i>必填，不能超过50个字符</i>
    </li>
    <li>
      <label>状态</label>
      <select class="dfselect" name="brandStatus">
          <option value="1" th:selected="${cbrand.brandStatus==1}">可用</option>
          <option value="2" th:selected="${cbrand.brandStatus==2}">不可用</option>
        </select>
      <i>必选</i>
    </li>
    <li>
      <label>创建人</label>
      <input name="createId" type="hidden" th:value="${cbrand.user.uId}">
      <input name="" type="text" th:value="${cbrand.user.uname}" readonly="readonly" class="roinput" />
      <i>不能编辑</i>
    </li>
    <li>
      <label>创建时间</label>
      <input name="createTime" type="text" th:value="${#dates.format(cbrand.createTime,'yyyy-MM-dd')}" readonly="readonly" class="roinput" />
      <i>不能编辑</i>
    </li>
    <li>
      <label>&nbsp;</label>
      <input name="" type="button" onclick="submit1()" class="btn" value="确定"/>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      <input name="" type="button" class="btn" value="返回" onclick="window.location.href='/erp/purchase/cbrand/cblist'"/>
    </li>
  </ul>
  </form>
</div>
<script>
  function nonull() {
    var val = $("input[name=brandName]").val();
    if(val!="" && val!=null){
      return true;
    }else{
      return false;
    }
  };

  function submit1() {
    if(nonull()){
      $("#bform").submit();
    }else{
      alert("品牌名称不能为空");
    }
  };
</script>
</body>
</html>
